/*
 * @FilePath: /tads/server/app/business/models/tactics_topo.go
 * @Author: wnina0x0
 * @Date: 2025-04-16 14:11:19
 * @Description:
 *
 * 版权信息 : 2025 by wnina0x0, All Rights Reserved.
 */
package models

import (
	"time"

	"gorm.io/gorm"
)

type TacticsTopo struct {
	ID             uint           `gorm:"primaryKey;autoIncrement;column:id;comment:主键ID" json:"id"`
	TacticTopoDesc string         `gorm:"size:100;not null;column:tactic_topo_desc;comment:场景名" json:"tactic_topo_desc"`
	TacticTopoData string         `gorm:"type:text;column:tactic_topo_data;index;comment:场景拓扑ID" json:"tactic_topo_data"`
	Creator        string         `gorm:"size:50;not null;column:creator;comment:创建者" json:"creator"`
	CreateTime     time.Time      `gorm:"type:timestamp;default:now();not null;column:create_time;comment:创建时间" json:"create_time"`
	Updater        string         `gorm:"size:50;not null;column:updater;comment:更新者" json:"updater"`
	UpdateTime     time.Time      `gorm:"type:timestamp;default:now();not null;column:update_time;comment:更新时间" json:"update_time"`
	DeletedTime    gorm.DeletedAt `gorm:"index" json:"-"`
}

func (TacticsTopo) TableName() string {
	return "t_tactics_topo"
}

func (s *TacticsTopo) BeforeUpdate(tx *gorm.DB) (err error) {
	s.UpdateTime = time.Now()
	return
}
